package session07.homework;

import javax.swing.*;
import java.awt.*;

public class BottomPanel extends JPanel {

    private JLabel txtLab1;
    private JLabel txtLab2;
    private JLabel txtLab3;
    private JLabel txtLab4;
    private JLabel txtLab5;
    private JLabel txtLab6;
    private JLabel txtLab7;
    private JLabel txtLab8;


    private JComboBox<String> comb1;
    private JComboBox<String> comb2;
    private JComboBox<String> comb3;


    private JPasswordField psw;

    private JTextField text1;
    private JTextField text2;
    private JTextField text3;
    private JTextField text4;

    private JButton b1;
    private JCheckBox btn1;

    public BottomPanel() {
        this.setLayout(null);
        this.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(188, 211, 231), 1), "网络设置"));

        this.setBackground(new Color(225, 249, 255));
        this.txtLab1 = new JLabel("类型：");
        this.txtLab1.setBounds(10, 20, 40, 20);
        this.comb1 = new JComboBox<>();
        comb1.addItem("不使用代理");
        comb1.addItem("SOCKS5代理");
        comb1.addItem("HTTP代理");
        comb1.addItem("使用浏览器设置");
        this.comb1.setBounds(50, 20, 120, 25);

        this.txtLab2 = new JLabel("地址：");
        this.txtLab2.setBounds(10, 60, 40, 20);
        this.text1 = new JTextField();
        this.text1.setBounds(50, 60, 130, 25);

        this.txtLab3 = new JLabel("端口：");
        this.txtLab3.setBounds(180, 60, 40, 20);
        this.text2 = new JTextField();
        this.text2.setBounds(220, 60, 100, 25);

        this.txtLab4 = new JLabel("用户：");
        this.txtLab4.setBounds(10, 90, 40, 20);
        this.text3 = new JTextField();
        this.text3.setBounds(50, 90, 130, 25);

        this.txtLab5 = new JLabel("密码：");
        this.txtLab5.setBounds(180, 90, 40, 20);
        this.psw = new JPasswordField();
        this.psw.setBounds(220, 90, 100, 25);

        this.txtLab6 = new JLabel("域（可不填）：");
        this.txtLab6.setBounds(10, 120, 100, 20);
        this.text4 = new JTextField();
        this.text4.setBounds(110, 120, 100, 25);
        this.b1 = new JButton("测试");
        this.b1.setEnabled(false);
        this.b1.setBounds(250, 120, 60, 30);

        this.btn1 = new JCheckBox("选择QQ登录服务器");
        this.btn1.setBounds(15, 150, 150, 20);

        this.txtLab7 = new JLabel("设置你要登录到的服务器类型");
        this.txtLab7.setBounds(10, 180, 180, 20);

        this.comb2 = new JComboBox<>();
        this.comb2.addItem("UDP类型");
        this.comb2.addItem("不使用高级类型");
        this.comb2.addItem("TCP类型");
        this.comb2.addItem("会员VIP类型");
        this.comb2.setEnabled(false);
        this.comb2.setBounds(190, 180, 120, 25);


        this.txtLab8 = new JLabel("需要登录的服务器地址");
        this.txtLab8.setBounds(10, 210, 140, 20);
        this.comb3 = new JComboBox<>();
        this.comb3.addItem("sz1.tencent.com");
        this.comb3.addItem("sz2.tencent.com");
        this.comb3.addItem("sz3.tencent.com");
        this.comb3.setEnabled(false);
        this.comb3.setBounds(190, 210, 120, 25);

        this.add(txtLab1);
        this.add(comb1);
        this.add(txtLab2);
        this.add(text1);
        this.add(txtLab3);
        this.add(text2);
        this.add(txtLab4);
        this.add(text3);
        this.add(txtLab5);
        this.add(psw);
        this.add(txtLab6);
        this.add(text4);
        this.add(b1);
        this.add(btn1);
        this.add(txtLab7);
        this.add(comb2);
        this.add(txtLab8);
        this.add(comb3);
    }
}
